clang-tidy readability-isolate-declaration (#1274)
authortsteven4 <13596209+tsteven4@users.noreply.github.com>
Sat, 4 May 2024 16:48:07 +0000 (10:48 -0600)
committerGitHub <noreply@github.com>
Sat, 4 May 2024 16:48:07 +0000 (10:48 -0600)
22 files changed:
exif.cc
garmin_fit.cc
garmin_gpi.cc
garmin_txt.cc
garmin_xt.cc
gdb.cc
gpx.cc
grtcirc.cc
igc.cc
kml.cc
lowranceusr.cc
nmea.cc
osm.cc
ozi.cc
parse.cc
skytraq.cc
smplrout.cc
text.cc
tpg.cc
trackfilter.cc
unicsv.cc
xcsv.cc

diff --git a/exif.cc b/exif.cc
index 6521cbb644e6ccaade9beafa12f158568e66ec33..14d194865ce931ec17b78c241f22af855791dfac 100644 (file)
--- a/exif.cc
+++ b/exif.cc
@@ -579,7 +579,9 @@ void
 ExifFormat::exif_read_app(ExifApp* app)
 {
   gbsize_t offs;
-  uint32_t exif_ifd_ofs, gps_ifd_ofs, inter_ifd_ofs;
+  uint32_t exif_ifd_ofs;
+  uint32_t gps_ifd_ofs;
+  uint32_t inter_ifd_ofs;
   ExifIfd* ifd;
   gbfile* fin = app->fexif;
 
index 3982216f8a5453d4ec0ff6edba7391dbee85643a..a5fac1185e13ffc34d776815804bb79ccbc6bfef 100644 (file)
@@ -1151,7 +1151,8 @@ GarminFitFormat::fit_collect_track_tlr(const route_head* rte)
   // Recalculate odometer_distance for the whole track unless already
   // (properly, i.e. monotonically increasing) set
   double dist_sum = 0;
-  double prev_lat = 999, prev_lon = 999;
+  double prev_lat = 999;
+  double prev_lon = 999;
   double max_speed = 0;
   gpsbabel::DateTime prev_time;
   for (auto& crpt: course) {
@@ -1216,8 +1217,13 @@ GarminFitFormat::fit_collect_track_tlr(const route_head* rte)
   }
 
   // Use current time as creation time if we have nothing better
-  gpsbabel::DateTime track_date_time, track_end_date_time, creation_time;
-  double first_lat = 999, first_lon = 999, last_lat = 999, last_lon = 999;
+  gpsbabel::DateTime track_date_time;
+  gpsbabel::DateTime track_end_date_time;
+  gpsbabel::DateTime creation_time;
+  double first_lat = 999;
+  double first_lon = 999;
+  double last_lat = 999;
+  double last_lon = 999;
   if (!course.empty()) {
     track_date_time = creation_time = course.front().creation_time;
     track_end_date_time = course.back().creation_time;
index 3877de63c94e5f89a8c40a2bf18a2f5d8c063705..745f68c2f6ce398e16334285cdc2c05c596ecc8e 100644 (file)
@@ -159,7 +159,8 @@ GarminGPIFormat::gpi_read_string(const char* field) const
 void
 GarminGPIFormat::read_header()
 {
-  int len, i;
+  int len;
+  int i;
 
   i = gbfgetint32(fin);
   if (i != 0) {
@@ -1053,9 +1054,11 @@ GarminGPIFormat::enum_waypt_cb(const Waypoint* ref) const
 void
 GarminGPIFormat::load_bitmap_from_file(const char* fname, const unsigned char** data, int* data_sz)
 {
-  int i, sz;
+  int i;
+  int sz;
   int dest_bpp;
-  int src_line_sz, dest_line_sz;
+  int src_line_sz;
+  int dest_line_sz;
   bmp_header_t src_h;
   gpi_bitmap_header_t* dest_h;
   unsigned char* ptr;
index 81f5d1b59e97df1a24011dd9e0ca6050c7e86d87..db0db9a84604d6d202744195dba9f41fe1746392 100644 (file)
@@ -193,9 +193,13 @@ void
 GarminTxtFormat::print_position(const Waypoint* wpt)
 {
   int valid = 1;
-  double lat, lon, north, east;
+  double lat;
+  double lon;
+  double north;
+  double east;
   int zone;
-  char map[3], zonec;
+  char map[3];
+  char zonec;
 
   convert_datum(wpt, &lat, &lon);
 
index a0f4cc48e369f9a01a807c4c0d87eed628625f56..6f96b2b130296d6259b33595eb7b8764368165d7 100644 (file)
@@ -64,7 +64,10 @@ GarminXTFormat::format_garmin_xt_rd_st_attrs(char* p_trk_name, uint8_t* p_track_
 {
   int          method = 0;
   uint8_t      spam = 0;
-  int32_t              TrackMaxLat = 0, TrackMaxLon = 0, TrackMinLat = 0, TrackMinLon = 0;
+  int32_t               TrackMaxLat = 0;
+  int32_t               TrackMaxLon = 0;
+  int32_t               TrackMinLat = 0;
+  int32_t               TrackMinLon = 0;
   char         trk_name[30]="";
   // TODO: SHIFT - can't test behaviour, do not have appropriate files
   //int                ii;
@@ -205,9 +208,13 @@ GarminXTFormat::format_garmin_xt_proc_strk()
   int          Count = 0; // Used to obtain number of read bytes
   int TracksCompleted = 0; // Number of processed tracks
   uint8_t      TrackBlock[STRK_BLOCK_SIZE]; // File Block
-  double               Lat = 0, Lon = 0; // wpt data
-  double               PrevLat = 0, PrevLon = 0, PrevEle = 0; // wpt data
-  uint32_t     Time = 0, PrevTime = 0; // wpt data
+  double                Lat = 0;
+  double                Lon = 0; // wpt data
+  double                PrevLat = 0;
+  double                PrevLon = 0;
+  double                PrevEle = 0; // wpt data
+  uint32_t      Time = 0;
+  uint32_t      PrevTime = 0; // wpt data
   uint8_t      trk_color = 0xff;
 
   // Skip 12 bytes from the BOF
diff --git a/gdb.cc b/gdb.cc
index db3bec6a58febb265629371446a6ad7dc09e9571..47f0d072ae5fe44dfcec641dd9523c670f3114ae 100644 (file)
--- a/gdb.cc
+++ b/gdb.cc
@@ -992,7 +992,8 @@ GdbFormat::read()
     char typ;
     gt_waypt_classes_e wpt_class;
     Waypoint* wpt;
-    route_head* trk, *rte;
+    route_head* trk;
+    route_head* rte;
 
     int len = FREAD_i32;
     if (FREAD(&typ, 1) < 1) {
@@ -1182,7 +1183,8 @@ GdbFormat::write_waypoint(
   const Waypoint* wpt, const QString& shortname, const garmin_fs_t* gmsd,
   const int icon, const int display)
 {
-  char zbuf[32], ffbuf[32];
+  char zbuf[32];
+  char ffbuf[32];
 
   waypt_ct++;  /* increase informational number of written waypoints */
 
@@ -1335,7 +1337,8 @@ void
 GdbFormat::write_route(const route_head* rte, const QString& rte_name)
 {
   bounds bounds;
-  char zbuf[32], ffbuf[32];
+  char zbuf[32];
+  char ffbuf[32];
 
   memset(zbuf, 0, sizeof(zbuf));
   memset(ffbuf, 0xFF, sizeof(ffbuf));
diff --git a/gpx.cc b/gpx.cc
index 04e3e408b31d5153504b8849b5ae5a520f672650..45430bdb56507b9bc9e54a706817890db0865a9e 100644 (file)
--- a/gpx.cc
+++ b/gpx.cc
@@ -505,7 +505,12 @@ xml_parse_time(const QString& dateTimeString)
     *pointstr = '\0';
   }
 
-  int year = 0, mon = 1, mday = 1, hour = 0, min = 0, sec = 0;
+  int year = 0;
+  int mon = 1;
+  int mday = 1;
+  int hour = 0;
+  int min = 0;
+  int sec = 0;
   gpsbabel::DateTime dt;
   int res = sscanf(timestr, "%d-%d-%dT%d:%d:%d", &year, &mon, &mday, &hour,
                    &min, &sec);
index 52a002cf424e576e80c5aee2d88e951caa61c04d..94ea141f9c5821a21f80c34276334f5c3f1f7a4b 100644 (file)
@@ -134,9 +134,16 @@ double linedistprj(double lat1, double lon1,
   static double _lon1 = -9999;
   static double _lon2 = -9999;
 
-  static double x1, y1, z1;
-  static double x2, y2, z2;
-  static double xa, ya, za, la;
+  static double x1;
+  static double y1;
+  static double z1;
+  static double x2;
+  static double y2;
+  static double z2;
+  static double xa;
+  static double ya;
+  static double za;
+  static double la;
 
   double dot;
 
diff --git a/igc.cc b/igc.cc
index 817f527a1984d6916b55c1f55af937dc083b72af..23b02647051544ed2eae1b7d7e07722d935c7446 100644 (file)
--- a/igc.cc
+++ b/igc.cc
@@ -128,9 +128,14 @@ void IgcFormat::rd_deinit()
  */
 void IgcFormat::TaskRecordReader::igc_task_rec(const char* rec)
 {
-  unsigned int lat_deg, lat_min, lat_frac;
-  unsigned int lon_deg, lon_min, lon_frac;
-  char lat_hemi[2], lon_hemi[2];
+  unsigned int lat_deg;
+  unsigned int lat_min;
+  unsigned int lat_frac;
+  unsigned int lon_deg;
+  unsigned int lon_min;
+  unsigned int lon_frac;
+  char lat_hemi[2];
+  char lon_hemi[2];
   char tmp_str[kMaxRecLen];
 
   // First task record identifies the task to follow
@@ -234,14 +239,22 @@ void IgcFormat::TaskRecordReader::igc_task_rec(const char* rec)
 void IgcFormat::read()
 {
   char* ibuf;
-  int hours, mins, secs;
-  unsigned int lat_deg, lat_min, lat_frac;
-  unsigned int lon_deg, lon_min, lon_frac;
-  char lat_hemi[2], lon_hemi[2];
+  int hours;
+  int mins;
+  int secs;
+  unsigned int lat_deg;
+  unsigned int lat_min;
+  unsigned int lat_frac;
+  unsigned int lon_deg;
+  unsigned int lon_min;
+  unsigned int lon_frac;
+  char lat_hemi[2];
+  char lon_hemi[2];
   char validity;
   route_head* pres_head = nullptr;
   route_head* gnss_head = nullptr;
-  int pres_alt, gnss_alt;
+  int pres_alt;
+  int gnss_alt;
   char pres_valid = 0;
   char gnss_valid = 0;
   Waypoint* pres_wpt = nullptr;
diff --git a/kml.cc b/kml.cc
index d7e9c826b49a9cba1d200b4a472f6efaf9173fe2..db5bfbd7578a6ab8dd271e0f6cf6004e9b41283d 100644 (file)
--- a/kml.cc
+++ b/kml.cc
@@ -199,7 +199,9 @@ void KmlFormat::wpt_ts_end(const QString& args, const QXmlStreamAttributes* /*at
 
 void KmlFormat::wpt_coord(const QString& args, const QXmlStreamAttributes* /*attrs*/)
 {
-  double lat, lon, alt;
+  double lat;
+  double lon;
+  double alt;
   if (! wpt_tmp) {
     return;
   }
@@ -345,7 +347,9 @@ void KmlFormat::gx_trk_coord(const QString& args, const QXmlStreamAttributes* /*
     fatal(MYNAME ": gx_trk_coord: invalid kml file\n");
   }
 
-  double lat, lon, alt;
+  double lat;
+  double lon;
+  double alt;
   int n = sscanf(CSTR(args), "%lf %lf %lf", &lon, &lat, &alt);
   if (EOF != n && 2 != n && 3 != n) {
     fatal(MYNAME ": coord field decode failure on \"%s\".\n", qPrintable(args));
index 37201990f43e2dbf88d9a51791aa5d14db7b659c..c264a79565d9cf7dfbb2805742f4c4197543f4ff 100644 (file)
@@ -1260,7 +1260,8 @@ LowranceusrFormat::read()
 void
 LowranceusrFormat::lowranceusr_waypt_disp(const Waypoint* wpt) const
 {
-  int SymbolId, alt;
+  int SymbolId;
+  int alt;
 
   int Lat = lat_deg_to_mm(wpt->latitude);
   int Lon = lon_deg_to_mm(wpt->longitude);
@@ -1410,7 +1411,8 @@ LowranceusrFormat::lowranceusr4_waypt_disp(const Waypoint* wpt)
      it means */
   gbfputint32(2, file_out);
 
-  int SymbolId, ColorId;
+  int SymbolId;
+  int ColorId;
   if (!wpt->gc_data->get_icon().isEmpty() && wpt->icon_descr.compare(u"Geocache Found") == 0) {
     if (writing_version == 4) {
       SymbolId = lowranceusr4_find_icon_number_from_desc(wpt->icon_descr);
diff --git a/nmea.cc b/nmea.cc
index 84129cd0a2106a11d505319ed30930a480abc5cc..e4087aa21365372b0865bf5982989dcd6b16f5ca 100644 (file)
--- a/nmea.cc
+++ b/nmea.cc
@@ -192,7 +192,9 @@ NmeaFormat::nmea_add_wpt(Waypoint* wpt, route_head* trk) const
   // transferred to either the global_waypoint_list or global_track_list.
   wpt->extra_data = nullptr;
   if (datum != kDautmWGS84) {
-    double lat, lon, alt;
+    double lat;
+    double lon;
+    double alt;
     GPS_Math_Known_Datum_To_WGS84_M(
       wpt->latitude, wpt->longitude, 0,
       &lat, &lon, &alt, datum);
@@ -669,7 +671,9 @@ NmeaFormat::gpgsa_parse(const QString& ibuf) const
     if (nfields > cnt + 3) prn[cnt] = fields[cnt + 3].toInt();
   }
 
-  float pdop = 0, hdop = 0, vdop = 0;
+  float pdop = 0;
+  float hdop = 0;
+  float vdop = 0;
   if (nfields > 15) pdop = fields[15].toFloat();
   if (nfields > 16) hdop = fields[16].toFloat();
   if (nfields > 17) vdop = fields[17].toFloat();
@@ -732,12 +736,24 @@ double NmeaFormat::pcmpt_deg(int d)
 void
 NmeaFormat::pcmpt_parse(const char* ibuf)
 {
-  int i, j1, j2, j3, j4, j5, j6;
-  int lat, lon;
-  char altflag, u1, u2;
-  float alt, f1, f2;
+  int i;
+  int j1;
+  int j2;
+  int j3;
+  int j4;
+  int j5;
+  int j6;
+  int lat;
+  int lon;
+  char altflag;
+  char u1;
+  char u2;
+  float alt;
+  float f1;
+  float f2;
   char coords[20] = {0};
-  int dmy, hms;
+  int dmy;
+  int hms;
 
   dmy = hms = 0;
 
diff --git a/osm.cc b/osm.cc
index 298f0b07c67fef4822fcc8c394e1dd44668d7041..f24f0ee49361ff468f4af078cce60f7643adfbb6 100644 (file)
--- a/osm.cc
+++ b/osm.cc
@@ -459,7 +459,8 @@ OsmFormat::osm_node(const QString& /*unused*/, const QXmlStreamAttributes* attrv
 void
 OsmFormat::osm_node_tag(const QString& /*unused*/, const QXmlStreamAttributes* attrv)
 {
-  QString key, value;
+  QString key;
+  QString value;
   signed char ikey;
 
   if (attrv->hasAttribute("k")) {
@@ -539,7 +540,8 @@ OsmFormat::osm_way_nd(const QString& /*unused*/, const QXmlStreamAttributes* att
 void
 OsmFormat::osm_way_tag(const QString& /*unused*/, const QXmlStreamAttributes* attrv)
 {
-  QString key, value;
+  QString key;
+  QString value;
   signed char ikey;
 
   if (attrv->hasAttribute("k")) {
diff --git a/ozi.cc b/ozi.cc
index d1ab73aa998a964b581535ba864fa123227f0bc8..8b981c4da257c83f01e40b1eb1273f2979e69bf1 100644 (file)
--- a/ozi.cc
+++ b/ozi.cc
@@ -127,7 +127,9 @@ void
 OziFormat::ozi_convert_datum(Waypoint* wpt) const
 {
   if (datum != kDautmWGS84) {
-    double lat, lon, alt;
+    double lat;
+    double lon;
+    double alt;
     GPS_Math_Known_Datum_To_WGS84_M(wpt->latitude, wpt->longitude, 0.0,
                                     &lat, &lon, &alt, datum);
     wpt->latitude = lat;
index e589e50792edbed854a8d4ac74ba8920e8447851..c1cb6b2eafbfa8ea8aa34f93e9ddbc57220a4bde 100644 (file)
--- a/parse.cc
+++ b/parse.cc
@@ -160,16 +160,23 @@ int
 parse_coordinates(const char* str, int datum, const grid_type grid,
                   double* latitude, double* longitude, const char* module)
 {
-  double lat, lon;
-  unsigned char lathemi=0, lonhemi=0;
-  int deg_lat, deg_lon, min_lat, min_lon;
+  double lat;
+  double lon;
+  unsigned char lathemi=0;
+  unsigned char lonhemi=0;
+  int deg_lat;
+  int deg_lon;
+  int min_lat;
+  int min_lon;
   char map[3];
   int utmz;
-  double utme, utmn;
+  double utme;
+  double utmn;
   char utmc;
   int result;
   int ct;
-  double lx, ly;
+  double lx;
+  double ly;
   const char* format;
 
   int valid = 1;
@@ -236,7 +243,8 @@ parse_coordinates(const char* str, int datum, const grid_type grid,
     break;
 
   case grid_swiss: {
-    double east, north;
+    double east;
+    double north;
 
     datum = kDautmWGS84;       /* fix */
     format = "%lf %lf%n";
index eca79199c9888a705ee827b3b30ac5ca6611377a..180547cbdcd642e7241e53cfa38dc857efacf209 100644 (file)
@@ -209,7 +209,9 @@ int
 SkytraqBase::skytraq_rd_msg(void* payload, unsigned int len) const
 {
   int errors = 5;              // Allow this many receiver errors silently.
-  unsigned int c, i, state;
+  unsigned int c;
+  unsigned int i;
+  unsigned int state;
   signed int rcv_len;          // Negative length is read error.
 
   for (i = 0, state = 0; i < RETRIES && state < sizeof(MSG_START); i++) {
@@ -417,7 +419,10 @@ SkytraqBase::skytraq_configure_logging() const
 {
   // an0008-1.4.14: logs if
   // (dt > tmin & dd >= dmin & v >= vmin) | dt > tmax | dd > dmax | v > vmax
-  unsigned int tmin=6, tmax=3600, dmin=0, dmax=10000;
+  unsigned int tmin=6;
+  unsigned int tmax=3600;
+  unsigned int dmin=0;
+  unsigned int dmax=10000;
   static uint8_t MSG_LOG_CONFIGURE_CONTROL[] = {
     0x18,                      // message_id
     0x00, 0x00, 0x0e, 0x10,    // max_time: was 0x0000ffff (big endian!)
@@ -768,7 +773,8 @@ SkytraqBase::process_data_item(read_state* pst, const item_frame* pitem, int len
 int    /* returns number of bytes processed (terminates on 0xFF i.e. empty or padding bytes) */
 SkytraqBase::process_data_sector(read_state* pst, const uint8_t* buf, int len) const
 {
-  int plen, ilen;
+  int plen;
+  int ilen;
 
   for (plen = 0; plen < len  &&  buf[plen] != 0xFF; plen += ilen) {
     ilen = process_data_item(pst, reinterpret_cast<const item_frame*>(&buf[plen]), len-plen);
@@ -787,7 +793,10 @@ SkytraqBase::skytraq_read_single_sector(unsigned int sector, uint8_t* buf) const
 {
   uint8_t MSG_LOG_SECTOR_READ_CONTROL[2] = { 0x1B, (uint8_t)(sector) };
   int errors = 5;              /* allow this many errors */
-  unsigned int c, i, j, cs;
+  unsigned int c;
+  unsigned int i;
+  unsigned int j;
+  unsigned int cs;
   uint8_t buffer[16];
 
   if (sector > 0xFF) {
@@ -926,8 +935,15 @@ SkytraqBase::skytraq_read_tracks() const
 {
   read_state st;
   uint32_t log_wr_ptr;
-  uint16_t sectors_free, sectors_total, /*sectors_used_a, sectors_used_b,*/ sectors_used;
-  int t, rc, got_sectors, total_sectors_read = 0;
+  uint16_t sectors_free;
+  uint16_t sectors_total;
+  /* uint16_t sectors_used_a; */
+  /* uint16_t sectors_used_b; */
+  uint16_t sectors_used;
+  int t;
+  int rc;
+  int got_sectors;
+  int total_sectors_read = 0;
   int read_at_once = MAX(xstrtoi(opt_read_at_once, nullptr, 10), 1);
   int opt_first_sector_val = xstrtoi(opt_first_sector, nullptr, 10);
   int opt_last_sector_val = xstrtoi(opt_last_sector, nullptr, 10);
@@ -1142,7 +1158,8 @@ SkytraqBase::skytraq_erase() const
 void
 SkytraqBase::skytraq_set_location() const
 {
-  double lat, lng;
+  double lat;
+  double lng;
   uint8_t MSG_SET_LOCATION[17] = { 0x36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
   uint8_t MSG_GET_LOCATION = 0x35;
 
@@ -1320,7 +1337,9 @@ void MinihomerFormat::miniHomer_get_poi() const
 {
   uint8_t MSG_GET_POI[3] = { 0x4D, 0, 0};
   uint8_t buf[32];
-  double lat, lng, alt;
+  double lat;
+  double lng;
+  double alt;
 
   for (unsigned int poi = 0; poi<NUMPOI; poi++) {
     MSG_GET_POI[1]=(poi>>8)&0xff;
@@ -1368,8 +1387,12 @@ int MinihomerFormat::miniHomer_set_poi(uint16_t poinum, const char* opt_poi) con
     0, 0, 0, 0, 0, 0, 0, 0,    //alt (double ecef)
     0                  // attr (u8, 1-> to flash, 0->ro sram)
   };
-  double lat, lng, alt;
-  double ecef_x, ecef_y, ecef_z;
+  double lat;
+  double lng;
+  double alt;
+  double ecef_x;
+  double ecef_y;
+  double ecef_z;
 
 
   int result = 0;              // result will be 0 if opt_poi isn't set
index 77bdcdc1f17caed540588b922e60c9999ba54506..5570991d7c723fad19a37490ff1d0b88709369e5 100644 (file)
@@ -119,7 +119,8 @@ double SimplifyRouteFilter::compute_track_error(const neighborhood& nb) const
         (wpt1->GetCreationTime() != wpt2->GetCreationTime())) {
       double frac = static_cast<double>(wpt1->GetCreationTime().msecsTo(wpt3->GetCreationTime())) /
                     static_cast<double>(wpt1->GetCreationTime().msecsTo(wpt2->GetCreationTime()));
-      double reslat, reslon;
+      double reslat;
+      double reslon;
       linepart(wpt1->latitude, wpt1->longitude,
                wpt2->latitude, wpt2->longitude,
                frac, &reslat, &reslon);
diff --git a/text.cc b/text.cc
index 46533eaa8d0b47e780e202149d65b2e4f9486f24..e288303d45afe8143dd54f738b092199ed7030e8 100644 (file)
--- a/text.cc
+++ b/text.cc
@@ -68,7 +68,8 @@ void
 TextFormat::text_disp(const Waypoint* wpt)
 {
   int32_t utmz;
-  double utme, utmn;
+  double utme;
+  double utmn;
   char utmzc;
 
   waypoint_count++;
diff --git a/tpg.cc b/tpg.cc
index 5b21552e3c19ea2db3beefb363d8007972b055a0..3fde1c2b75dcb66265eca29c192c7a85135e2c13 100644 (file)
--- a/tpg.cc
+++ b/tpg.cc
@@ -160,7 +160,8 @@ TpgFormat::read()
 void
 TpgFormat::tpg_waypt_pr(const Waypoint* wpt)
 {
-  double lon, lat;
+  double lon;
+  double lat;
   double amt;
   char ocount;
   QString shortname;
index f9ee348f918485206f447da4f7906364ac44fb82..bcb7b77d08efe838598a58fa732e5ee04ab108fa 100644 (file)
@@ -309,7 +309,8 @@ void TrackFilter::trackfilter_title()
 void TrackFilter::trackfilter_pack()
 {
   if (!track_list.isEmpty()) {
-    int i, j;
+    int i;
+    int j;
 
     for (i = 1, j = 0; i < track_list.size(); i++, j++) {
       auto prev_last_time = trackfilter_get_last_time(track_list.at(j));
@@ -702,7 +703,8 @@ QDateTime TrackFilter::trackfilter_range_check(const char* timestr)
 
 void TrackFilter::trackfilter_range()
 {
-  QDateTime start, stop; // constructed such that isValid() is false, unlike gpsbabel::DateTime!
+  QDateTime start; // constructed such that isValid() is false, unlike gpsbabel::DateTime!
+  QDateTime stop;  // constructed such that isValid() is false, unlike gpsbabel::DateTime!
 
   if (opt_start != nullptr) {
     start = trackfilter_range_check(opt_start);
index 040908078fdb9cc3f76c0086169bf3981333b33a..934df38669e10ece39697c32b9ebee782f59a0ec 100644 (file)
--- a/unicsv.cc
+++ b/unicsv.cc
@@ -227,7 +227,9 @@ UnicsvFormat::unicsv_parse_gc_code(const QString& str)
 QDate
 UnicsvFormat::unicsv_parse_date(const char* str, int* consumed)
 {
-  int p1, p2, p3;
+  int p1;
+  int p2;
+  int p3;
   char sep[2];
   std::tm tm{};
   int lconsumed = 0;
@@ -1260,7 +1262,9 @@ UnicsvFormat::unicsv_waypt_enum_cb(const Waypoint* wpt)
 void
 UnicsvFormat::unicsv_waypt_disp_cb(const Waypoint* wpt)
 {
-  double lat, lon, alt;
+  double lat;
+  double lon;
+  double alt;
   const Geocache* gc_data = nullptr;
   unicsv_waypt_ct++;
 
@@ -1300,7 +1304,8 @@ UnicsvFormat::unicsv_waypt_disp_cb(const Waypoint* wpt)
 
   case grid_bng: {
     char map[3];
-    double north, east;
+    double north;
+    double east;
 
     if (! GPS_Math_WGS84_To_UKOSMap_M(wpt->latitude, wpt->longitude, &east, &north, map)) {
       unicsv_fatal_outside(wpt);
@@ -1315,7 +1320,8 @@ UnicsvFormat::unicsv_waypt_disp_cb(const Waypoint* wpt)
   case grid_utm: {
     int zone;
     char zonec;
-    double north, east;
+    double north;
+    double east;
 
     if (! GPS_Math_Known_Datum_To_UTM_EN(lat, lon,
                                          &east, &north, &zone, &zonec, unicsv_datum_idx)) {
@@ -1328,7 +1334,8 @@ UnicsvFormat::unicsv_waypt_disp_cb(const Waypoint* wpt)
     break;
   }
   case grid_swiss: {
-    double north, east;
+    double north;
+    double east;
 
     if (! GPS_Math_WGS84_To_Swiss_EN(wpt->latitude, wpt->longitude, &east, &north)) {
       unicsv_fatal_outside(wpt);
diff --git a/xcsv.cc b/xcsv.cc
index 747660622d40da5922f92c902c2a5967d90f3911..f42a4effa4ca1062263648775e9b9b49ef2e0189 100644 (file)
--- a/xcsv.cc
+++ b/xcsv.cc
@@ -986,9 +986,11 @@ void
 XcsvFormat::xcsv_waypt_pr(const Waypoint* wpt)
 {
   QString buff;
-  double latitude, longitude;
+  double latitude;
+  double longitude;
   int32_t utmz;
-  double utme, utmn;
+  double utme;
+  double utmn;
   char utmzc;
 
   if (oldlon < 900) {
@@ -1223,7 +1225,8 @@ XcsvFormat::xcsv_waypt_pr(const Waypoint* wpt)
     /* SPECIAL COORDINATES */
     case XcsvStyle::XT_MAP_EN_BNG: {
       char map[3];
-      double north, east;
+      double north;
+      double east;
       if (! GPS_Math_WGS84_To_UKOSMap_M(wpt->latitude, wpt->longitude, &east, &north, map))
         fatal(MYNAME ": Position (%.5f/%.5f) outside of BNG.\n",
               wpt->latitude, wpt->longitude);